package com.zkthink.ceres.member.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

/**
 * <p>
 * 实体类
 * 会员推荐历史表
 * </p>
 *
 * @author ck
 * @since 2021-11-15
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_member_refer_his")
@ApiModel(value = "CeresMemberReferHis", description = "会员推荐历史表")
@AllArgsConstructor
public class CeresMemberReferHis extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 会员id
     */
    @ApiModelProperty(value = "会员id")
    @TableField("mid")
    @Excel(name = "会员id")
    private Long mid;

    /**
     * 被推荐人
     */
    @ApiModelProperty(value = "被推荐人")
    @TableField("to_user")
    @Excel(name = "被推荐人")
    private Long toUser;

    /**
     * 推荐时间
     */
    @ApiModelProperty(value = "推荐时间")
    @TableField("regist_time")
    @Excel(name = "推荐时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime registTime;

    /**
     * 逻辑删除 1-删除 0-未删除
     */
    @ApiModelProperty(value = "逻辑删除 1-删除 0-未删除")
    @TableField("is_delete")
    @Excel(name = "逻辑删除 1-删除 0-未删除")
    private Integer isDelete;


    @Builder
    public CeresMemberReferHis(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser,
                               Long mid, Long toUser, LocalDateTime registTime, Integer isDelete) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.mid = mid;
        this.toUser = toUser;
        this.registTime = registTime;
        this.isDelete = isDelete;
    }

}
